<template>
<div class="page">
    <div class="layui-fluid">      
      <div class="layui-card-body">	
	  <div class="layui-form" lay-filter="">
	  	<table class="layui-table">
		  <colgroup>
		    <col width="150">
		    <col width="200">
		    <col>
		  </colgroup>
		  <thead>
		    <tr>
		      <th>商品名称</th>
		      <th>规格</th>
		      <th>单价(元)</th>
		      <th>数量（个）</th>
		    </tr> 
		  </thead>
		  <tbody>
		    <tr v-for='item in orderinfo.orderItemVMS'>
		      <td>{{item.itemName}}</td>
		      <td>{{item.itemSku}}</td>
		      <td>{{item.price/100}}</td>
		      <td>{{item.amount}}</td>
		    </tr>		    
		  </tbody>
		  <tbody style="display:none" v-show="show==1">
		    <tr v-for='item in yhqlist'>		    	
		      <td>{{item.publishName}}-{{item.discountAmount/100}}</td>		      	      
		    </tr>		    
		  </tbody>
		</table>
		
		 <div class="layui-form-item">
			<div class="layui-inline">
			    <label class="layui-form-label"></label>
			    <div class="layui-input-inline" >
			       <!-- <input type="text" name="" disabled="disabled" v-model="orderinfo.accountName" placeholder="" autocomplete="off" class="layui-input" maxlength="">-->
			    </div>										   
		  </div>
		</div>
        <div class="layui-form-item">
			<div class="layui-inline">
			    <label class="layui-form-label">账号</label>
			    <div class="layui-input-inline" >
			        <input type="text" name="" disabled="disabled" v-model="orderinfo.accountName" placeholder="" autocomplete="off" class="layui-input" maxlength="">
			    </div>										   
		  </div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
			    <label class="layui-form-label">收货人</label>
			    <div class="layui-input-inline" >
			        <input type="text" name="" disabled="disabled" v-model="orderinfo.receiveName" placeholder="" autocomplete="off" class="layui-input" maxlength="">
			    </div>										   
		  </div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
			    <label class="layui-form-label">手机</label>
			    <div class="layui-input-inline" >
			        <input type="text" name="" disabled="disabled" v-model="orderinfo.receiveMobile" placeholder="" autocomplete="off" class="layui-input" maxlength="">
			    </div>										   
		  </div>
		</div>
		<div class="layui-form-item layui-form-text">
		    <label class="layui-form-label">地址</label>
		    <div class="layui-input-block">
		      <textarea name="address"  disabled="disabled"  placeholder="" v-model="address" class="layui-textarea"></textarea>
		    </div>
	   </div>		
      	 <!--// -->      
      </div>
      </div>
    </div>
</div>
</template>
<script>
	import Tables from '../../common/tables.vue'
	import Search from '../../common/search.vue'
	export default {
	  name: 'ucdetail',
	  components: {Tables,Search},
	  data () {
	    return {	    	
	    	orderinfo:'',//回选   
	    	address:'',
	    	yhqlist:[],
	    	show:0,
	    }
	  },
	  mounted(){
	  	 var _this = this;   	
	     window.getdates = this.getdates;    	
	  },
	  methods: {
		getdates:function(data){		
			var _this = this;
			_this.getyhq(data.id);
			_this.id=data.id;					
			var url="/order/bapi/v1.9/order/"+_this.id						
			ajaxRequest(url,'GET','json','',function(ret,err){
				//alert(url+"///"+JSON.stringify(ret))
				_this.orderinfo=ret.data;
				_this.address=ret.data.regionName+""+ret.data.address;	
			})	
	   },	
	  getyhq:function(id){
	   	    var _this=this;
			var url="/order/bapi/v1.9/order-coupon/"+id;
	        ajaxRequest(url,'GET','json','',function(ret,err){
			 	//console.log(JSON.stringify(ret))
			 	
				_this.show=1;
				_this.yhqlist=ret.data;
						
	        })	   	
	   },
		screens:function(){
			return screen();
		},
    },
	updated:function(){
	  	this.isShow = true;
		layui.use('form', function(){
		  var form = layui.form;
		  form.render();
		});
	},
}
</script>
<style scoped>
/**/
</style>
